<?php
class login{
	public function connect($email, $password, $session)
	{
		$ci =& get_instance();
		
		$ci->load->library('user');
		
		$user = $ci->user->GetByEmail($email);
		
		if ($user->password == $password)
		{
			$ci->load->library('session');
			$ci->load->model('session_m');
			
			$sess = $ci->session_m;
			
			$sess = $ci->session->GetByContent($session);
			$sess = (object) $sess;
			
			$sess->iduser = $user->id;
			
			$ci->session->Update($sess);
		}
	}
}
?>